<template>
<div>
  <ul><li>{{news.title}}---{{news.content}}</li>
    <li v-for="i in news.comment">{{i.comment}}</li>
  </ul>

</div>
</template>

<script>
export default {
  name: "news_info",
  data(){
  return{
  id:this.$route.query.id,
  news:{}
  }
  },
  methods:{
  get_news(){
  this.$axios.get('/news/com?id='+this.id+'&userid='+localStorage.getItem('userid'))
  .then(res=>{
  if(res.data.code==200){
  this.news = res.data.list
  }
  else {
  alert(res.data.mes)
  }
  })

  }
  },
  mounted() {
  this.get_news()
  }
}
</script>

<style scoped>

</style>
